#include "sch/sch.h"
#include "json/reader.h"
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif

int main(int argc,char * argv[]) {
	std::string arg1;
	if (argc >= 2){
		arg1 = argv[1];
	} else{
		arg1 = "";
	}
	if (arg1 == "-h" || arg1 == "--help" || arg1 == "h" || arg1 == "help"){
		sch_help(argc,argv);
	}else if (arg1 == "-b" || arg1 == "--build" || arg1 == "b" || arg1 == "build"){
		sch_build(argc,argv);
	}else if (arg1 == "-i" || arg1 == "--install" || arg1 == "i" || arg1 == "install"){
		sch_install();
	}else if (arg1.empty()){
		sch_default();
	}else if(arg1 == "test"){

        Json::Reader reader;
        Json::Value root;
        const std::string a = "[1, 2]";
        if(!reader.parse(a, root)){
            std::cout << "Parse json error!";
            return -1;
        }
        std::cout << SCH_BUILD_SCH_BLOG << std::endl;
        std::cout << "Size = " << root.size() << std::endl;
        std::cout << root[0].asString() << std::endl;
    }else{
		print_title("");
		print_message("不支持的参数");
	}
	return 0;
}



